package kr.hkit.powerjava.chapter12.submit; 

import java.util.Scanner;

//프로그래밍 5번 메인

public class DimShapeTest { 

	public static void main(String[] args) {

		TwoDimShape[] sh2 = new TwoDimShape[3];
		sh2[0] = new Ellipse(3);
		sh2[1] = new Rectangle2(6,8);
		sh2[2] = new Triangle2(6,3,3);
		
		ThreeDimShape[] sh3 = new ThreeDimShape[3];
		sh3[0] = new Shpere(3);
		sh3[1] = new Cube(5,6,7);
		sh3[2] = new Cylinder(10,3);
		
		
		Scanner sc = new Scanner (System.in);
		System.out.print("2차원도형은 숫자 2, 3차원 도형은 숫자 3을 입력하시오");
		int k = sc.nextInt();
		
		if (k==2)
		for (TwoDimShape two : sh2) {
			two.getArea();
		}else {
		for (ThreeDimShape three : sh3) 
			three.getVolume();
		}
	}
}
